// 实现storage单例模式
function StorageBase() {
  StorageBase.prototype.getItem = function (key) {
    return localStorage.getItem(key)
  }

  StorageBase.prototype.setItem = function (key, value) {
    return localStorage.setItem(key, value)
  }
}

export const Storage = (function () {
  let instanse = null
  return function () {
    if (!instanse) {
      instanse = new StorageBase()
    }
    return instanse
  }
})()
